//
//  DHFshionWear_SingleCell.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/1/8.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHFshionWear_SingleCell.h"
#import "FashionArticle.h"

@interface DHFshionWear_SingleCell()

@property (weak, nonatomic) IBOutlet UIImageView *iconImgView;
@property (weak, nonatomic) IBOutlet YYLabel *titleLabel;
@property (weak, nonatomic) IBOutlet YYLabel *nameLabel;
@property (weak, nonatomic) IBOutlet YYLabel *likeLabel;

@end

@implementation DHFshionWear_SingleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.nameLabel.font = [UIFont systemFontOfSize:12];
    self.nameLabel.textColor = [UIColor colorWithHexString:@"#CDCDCD"];
    self.nameLabel.textVerticalAlignment = YYTextVerticalAlignmentBottom;
    
    self.likeLabel.font = [UIFont systemFontOfSize:14];
    self.likeLabel.textColor = [UIColor colorWithHexString:@"#9B9A9B"];
    self.likeLabel.textVerticalAlignment = YYTextVerticalAlignmentBottom;
    self.likeLabel.textAlignment = NSTextAlignmentRight;
    
    self.titleLabel.font = [UIFont systemFontOfSize:16];
    self.titleLabel.textColor = [UIColor colorWithHexString:@"#4A4A4A"];
    self.titleLabel.numberOfLines = 0;
    self.titleLabel.textVerticalAlignment = YYTextVerticalAlignmentCenter;
}

- (void)updateWith:(FashionArticle *)article{
    [self.iconImgView dh_setImageURLString:article.cover];
    self.titleLabel.text = article.title;
    self.nameLabel.text = [NSString stringWithFormat:@"%@  %@",article.owner.nickname, [NSString serverTimeToCurrentTimeDifference:article.createdAt]];
    self.likeLabel.text = [NSString stringWithFormat:@"评论(%@)  点赞(%@)",article.comment_count, article.nice_count];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
